<?php
include ("../lib/BLL/DmDanTocBLL.php");

$thongbao="";
$dantocBLL=new DanTocBLL();


if(isset($_POST['luu'])){
    $ma=$_POST['madantoc'];
    $ten=$_POST['tendantoc'];
    
    $dantoc= new DmDanToc();
    $dantoc->setdantoc($ma,$ten);
    $kq=$dantocBLL->Insertdantoc($dantoc);
    
    if($kq)
    {
        $thongbao="OK đã thêm";
    }else{
        $thongbao="SAI rồi nhé";
    }    
    
}
$smarty->assign('thongbao',$thongbao);



////////////////////////////////////////////////////////////////////////////////
$ds=$dantocBLL->GetlistDT();
/////////////////////////////////////////////////
$ten=$dantocBLL->getmadt('khac');
echo $ten;

    

$smarty->assign('ds_dt',$ds);
$smarty->display('danhmuc/dantoc.tpl')
?>